Skip to content

vonglasow/shellai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

ShellAI

If this script interests you, take a look at my new project: https://github.com/vonglasow/gaia

Requirements

Installation

MacOS

brew install ollama
ollama serve
ollama pull openhermes2.5-mistral

git clone git@github.com:vonglasow/shellai.git

You must have a ollama serve running somewhere Add the path of shellai into your $PATH

Usage

$ shellai -h
usage: shellai [-h] [-s] [-c] [-d] [--display-config] [--generate-config] [strings ...]

Process user input and command-line arguments.

positional arguments:
  strings            Additional strings to process (default: None)

options:
  -h, --help         show this help message and exit
  -s, --shell        Generate shell commands (default: False)
  -c, --code         Generate code from message (default: False)
  -d, --describe     Describe inputs (default: False)
  --display-config   Display current config (default: False)
  --generate-config  Generate a default config file (default: False)

Example usage:
  Generate a shell command
    $ shellai --shell "Generate a command to find all yaml file and delete it"
  Generate code
    $ shellai --code "Generate a function to return fibonnacci"
  Describe informations
    $ git diff | shellai --describe "Generate a git commit message"
$ cat CVE-2021-4034.py | shellai -d "Analyze and explain this code"
This code is a Python script that exploits the CVE-2021-4034 vulnerability in Python. It was originally written by Joe Ammond, who used it as an experiment to see if he could get it to work in Python while also playing around with ctypes.

The code starts by importing necessary libraries and defining variables. The `base64` library is imported to decode the payload, while the `os` library is needed for certain file operations. The `sys` library is used to handle system-level interactions, and the `ctypes` library is used to call the `execve()` function directly.

The code then decodes a base64 encoded ELF shared object payload from a previous command (in this case, using msfvenom). This payload is created with the PrependSetuid=true flag so that it can run as root instead of just the user.

An environment list is set to configure the call to `execve()`. The code also finds the C library, loads the shared library from the payload, creates a temporary file for exploitation, and makes necessary directories.

The code ends with calling the `execve()` function using the C library found earlier, passing in NULL arguments as required by `execve()`.

Thanks

Heavily inspired by shell_gpt

About

shell for AI inspired by shell_GPT with ollama

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages